cmake_minimum_required(VERSION 3.22)

project(Device)
add_library(Device INTERFACE)

# Enable CMake support for ASM and C languages
enable_language(C ASM)

target_include_directories(Device INTERFACE
    Inc

)

target_sources(Device INTERFACE
    Src/device.c
    Src/led.c
    Src/button.c
    Src/multi_button.c
    Src/uart.c
    # Src/oled.c
    # Src/tm1650_dig.c
    # Src/aht20.c
    Src/w25qxx.c
)

# Validate that STM32CubeMX code is compatible with C standard
if(CMAKE_C_STANDARD LESS 11)
    message(ERROR "Generated code requires C11 or higher")
endif()


